-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query that creates inbox and mam delete domain statement #3924
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 83.15% // Head: 83.13% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3924 +/- ##
==========================================
- Coverage 83.15% 83.13% -0.03%
==========================================
Files 535 535
Lines 34110 34127 +17
==========================================
+ Hits 28364 28371 +7
- Misses 5746 5756 +10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
95dc3b2
to
414a617
Compare
This comment was marked as outdated.
This comment was marked as outdated.
414a617
to
3aab37f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3aab37f
to
efe3671
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ea68968
to
9feb307
Compare
9feb307
to
68aeff8
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
7381c56
to
42a246d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4ab9ef1
to
e658b06
Compare
small_tests_24 / small_tests / 4ab9ef1 small_tests_25 / small_tests / 4ab9ef1 ldap_mnesia_24 / ldap_mnesia / 4ab9ef1 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4ab9ef1 ldap_mnesia_25 / ldap_mnesia / 4ab9ef1 dynamic_domains_mysql_redis_25 / mysql_redis / 4ab9ef1 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 4ab9ef1 internal_mnesia_25 / internal_mnesia / 4ab9ef1 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 4ab9ef1 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 4ab9ef1 pgsql_mnesia_24 / pgsql_mnesia / 4ab9ef1 riak_mnesia_24 / riak_mnesia / 4ab9ef1 mysql_redis_25 / mysql_redis / 4ab9ef1 pgsql_mnesia_25 / pgsql_mnesia / 4ab9ef1 mssql_mnesia_25 / odbc_mssql_mnesia / 4ab9ef1 |
small_tests_24 / small_tests / e658b06 small_tests_25 / small_tests / e658b06 ldap_mnesia_24 / ldap_mnesia / e658b06 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / e658b06 ldap_mnesia_25 / ldap_mnesia / e658b06 dynamic_domains_mysql_redis_25 / mysql_redis / e658b06 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / e658b06 internal_mnesia_25 / internal_mnesia / e658b06 pgsql_mnesia_24 / pgsql_mnesia / e658b06 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / e658b06 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / e658b06 riak_mnesia_24 / riak_mnesia / e658b06 mysql_redis_25 / mysql_redis / e658b06 pgsql_mnesia_25 / pgsql_mnesia / e658b06 pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2699@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2699@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"ZFHie0+jf5M9zTtWHz8E4g==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} mssql_mnesia_25 / odbc_mssql_mnesia / e658b06 pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2702@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2702@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"emhZVbBEsuZASjAEAsVkmw==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription{error,
{{badmatch,
[{xmlel,<<"message">>,
[{<<"from">>,
<<"alice_unsubscribe_after_presence_unsubscription_2713@localhost">>},
{<<"to">>,
<<"bob_unsubscribe_after_presence_unsubscription_2713@localhost/res1">>},
{<<"type">>,<<"headline">>}],
[{xmlel,<<"event">>,
[{<<"xmlns">>,
<<"http://jabber.org/protocol/pubsub#event">>}],
[{xmlel,<<"items">>,
[{<<"node">>,<<"yRFECnRdX4+4JeseA9o6Mw==">>}],
[{xmlel,<<"item">>,
[{<<"id">>,<<"salmon">>}],
[{xmlel,<<"entry">>,
[{<<"xmlns">>,
<<"http://www.w3.org/2005/Atom">>}],
[]}]}]}]},
{xmlel,<<"headers">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
[]}]}]},
[{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,384}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} mssql_mnesia_25 / odbc_mssql_mnesia / e658b06 inbox_extensions_SUITE:regular:one_to_one:pagination:pagination_overrides_form{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"mike_pagination_overrides_form_1580@localhost/res1">>,
escalus_tcp,<0.11214.1>,
[{event_manager,<0.11162.1>},
{server,<<"localhost">>},
{username,<<"mike_pagination_overrides_form_1580">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.11162.1>},
{server,<<"localhost">>},
{username,<<"mike_pagination_overrides_form_1580">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"mike_pagination_overrides_form_1580">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"mike_pagination_overrides_form_1580">>},
{server,<<"localhost">>},
{password,<<"nicniema">>},
{stream_id,<<"eeb8ede2371cf584">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
{inbox_extensions_SUITE,'-pagination_overrides_form/1-fun-0-',4,
[{file,
... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_be_limited{error,
{{inbox_size,3,
[{times,1,
{error,
#{check_params => #{},error => function_clause,
expected_items =>
[#{content => <<"Msg 3">>,
from => <<"alice_max_queries_can_be_limited_1583@localhost/res1">>,
to => <<"mike_max_queries_can_be_limited_1583@localhost/res1">>,
unread => 0,verify => #Fun<inbox_helper.28.35890797>},
#{content => <<"Msg 2">>,
from => <<"alice_max_queries_can_be_limited_1583@localhost/res1">>,
to => <<"kate_max_queries_can_be_limited_1583@localhost/res1">>,
unread => 0,verify => #Fun<inbox_helper.28.35890797>},
#{content => <<"Msg 1">>,
from => <<"alice_max_queries_can_be_limited_1583@localhost/res1">>,
to => <<"bob_max_queries_can_be_limited_1583@localhost/res1">>,
unread => 0,verify => #Fun<inbox_helper.28.35890797>}],
inbox_items =>
[<<"<message from='alice_max_queries_can_be_limited_1583@localhost' to='alice_max_queries_can_be_limited_1583@localhost/res1' id='1673-365176-392063'><result xmlns='erlang-solutions.com:xmpp:inbox:0' unread='0' queryid='6fa8dfc8cd3c25119176deea64ceb691'><forwarded xmlns='urn:xmpp:forward:0'><delay xmlns='urn:xmpp:delay' stamp='2023-01-10T15:39:31.422027Z'/><message from='alice_max_queries_can_be_limited_1583@localhost/res1' xml:lang='en' to='mike_max_queries_can_be_limited_1583@localhost/res1' type='chat' xmlns='jabber:client'><body>Msg 3</body></message></forwarded><read>true</read><box>inbox</box><archive>false</archive><mute>0<... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_fetch_ahead{error,
{{inbox_size,2,
[{times,1,
{error,
#{check_params => #{},error => function_clause,
expected_items =>
[#{content => <<"Msg 2">>,
from =>
<<"alice_max_queries_can_fetch_ahead_1585@localhost/res1">>,
to => <<"kate_max_queries_can_fetch_ahead_1585@localhost/res1">>,
unread => 0,verify => #Fun<inbox_helper.28.35890797>},
#{content => <<"Msg 1">>,
from =>
<<"alice_max_queries_can_fetch_ahead_1585@localhost/res1">>,
to => <<"bob_max_queries_can_fetch_ahead_1585@localhost/res1">>,
unread => 0,verify => #Fun<inbox_helper.28.35890797>}],
inbox_items =>
[<<"<message from='alice_max_queries_can_fetch_ahead_1585@localhost' to='alice_max_queries_can_fetch_ahead_1585@localhost/res1' id='1673-365176-402419'><result xmlns='erlang-solutions.com:xmpp:inbox:0' unread='0' queryid='5ba295857cbe86c48613f5de0e0510de'><forwarded xmlns='urn:xmpp:forward:0'><delay xmlns='urn:xmpp:delay' stamp='2023-01-10T15:39:27.005185Z'/><message from='alice_max_queries_can_fetch_ahead_1585@localhost/res1' xml:lang='en' to='bob_max_queries_can_fetch_ahead_1585@localhost/res1' type='chat' xmlns='jabber:client'><body>Msg 1</body></message></forwarded><read>true</read><box>inbox</box><archive>false</archive><mute>0</mute></result></message>">>],
query_params =>
#{box => inbox,'end' => <<"2023-01-10T15:39:36.392449Z">>,limit => 2},
reason => inbox_mismatch,
stacktrace =>
[{lists,zip,
[[],
[{conv... mssql_mnesia_25 / odbc_mssql_mnesia / e658b06 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 It would be good to add tests for MAM incremental deletion, it's just a bit sad to see the coverage go down.
Oh but there are tests for it, I don't know why here codecov reports bad coverage but locally my tests report to hit that path correctly 🤷🏽
|
This was passing because both with and without increments, the query created was under the same name, so then in tests the non-incremental test was running first and creating the prepared query that would remove everything. So then when the group with incremental delete was running, it would fail to create the right query but it would reuse the old one. In production though, the query created would fail because it is not valid SQL and we wouldn't know that until after the query is ran.
By ensuring that the used query has a different name, we can at least be sure we are not actually just using the plain one.
Unfortunately, I don't know of a way to make this work for mssql easily, syntax is entirely different. Already the current
select *
over a select is a compromise between pgsql and mysql.